import 'package:grocery_app_demo/api/entity/wait_for_purchase_goods_entity.dart';
import 'package:grocery_app_demo/generated/json/base/json_convert_content.dart';

WaitForPurchaseGoodsEntity $WaitForPurchaseGoodsEntityFromJson(
    Map<String, dynamic> json) {
  final WaitForPurchaseGoodsEntity waitForPurchaseGoodsEntity =
      WaitForPurchaseGoodsEntity();
  final String? goodsCode = jsonConvert.convert<String>(json['goodsCode']);
  if (goodsCode != null) {
    waitForPurchaseGoodsEntity.goodsCode = goodsCode;
  }
  final String? goodsName = jsonConvert.convert<String>(json['goodsName']);
  if (goodsName != null) {
    waitForPurchaseGoodsEntity.goodsName = goodsName;
  }
  final int? count = jsonConvert.convert<int>(json['count']);
  if (count != null) {
    waitForPurchaseGoodsEntity.count = count;
  }
  final int? weight = jsonConvert.convert<int>(json['weight']);
  if (weight != null) {
    waitForPurchaseGoodsEntity.weight = weight;
  }
  final int? shipperId = jsonConvert.convert<int>(json['shipperId']);
  if (shipperId != null) {
    waitForPurchaseGoodsEntity.shipperId = shipperId;
  }
  final String? shipperName = jsonConvert.convert<String>(json['shipperName']);
  if (shipperName != null) {
    waitForPurchaseGoodsEntity.shipperName = shipperName;
  }
  final String? unit = jsonConvert.convert<String>(json['unit']);
  if (unit != null) {
    waitForPurchaseGoodsEntity.unit = unit;
  }
  final int? standardWeight = jsonConvert.convert<int>(json['standardWeight']);
  if (standardWeight != null) {
    waitForPurchaseGoodsEntity.standardWeight = standardWeight;
  }
  final List<WaitForPurchaseGoodsOrders>? orders = jsonConvert
      .convertListNotNull<WaitForPurchaseGoodsOrders>(json['orders']);
  if (orders != null) {
    waitForPurchaseGoodsEntity.orders = orders;
  }
  return waitForPurchaseGoodsEntity;
}

Map<String, dynamic> $WaitForPurchaseGoodsEntityToJson(
    WaitForPurchaseGoodsEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['goodsCode'] = entity.goodsCode;
  data['goodsName'] = entity.goodsName;
  data['count'] = entity.count;
  data['weight'] = entity.weight;
  data['shipperId'] = entity.shipperId;
  data['shipperName'] = entity.shipperName;
  data['unit'] = entity.unit;
  data['standardWeight'] = entity.standardWeight;
  data['orders'] = entity.orders?.map((v) => v.toJson()).toList();
  return data;
}

WaitForPurchaseGoodsOrders $WaitForPurchaseGoodsOrdersFromJson(
    Map<String, dynamic> json) {
  final WaitForPurchaseGoodsOrders waitForPurchaseGoodsOrders =
      WaitForPurchaseGoodsOrders();
  final int? orderId = jsonConvert.convert<int>(json['orderId']);
  if (orderId != null) {
    waitForPurchaseGoodsOrders.orderId = orderId;
  }
  final String? orderNumber = jsonConvert.convert<String>(json['orderNumber']);
  if (orderNumber != null) {
    waitForPurchaseGoodsOrders.orderNumber = orderNumber;
  }
  final int? count = jsonConvert.convert<int>(json['count']);
  if (count != null) {
    waitForPurchaseGoodsOrders.count = count;
  }
  final String? consignee = jsonConvert.convert<String>(json['consignee']);
  if (consignee != null) {
    waitForPurchaseGoodsOrders.consignee = consignee;
  }
  final String? mobilePhone = jsonConvert.convert<String>(json['mobilePhone']);
  if (mobilePhone != null) {
    waitForPurchaseGoodsOrders.mobilePhone = mobilePhone;
  }
  final String? provinceName =
      jsonConvert.convert<String>(json['provinceName']);
  if (provinceName != null) {
    waitForPurchaseGoodsOrders.provinceName = provinceName;
  }
  final String? cityName = jsonConvert.convert<String>(json['cityName']);
  if (cityName != null) {
    waitForPurchaseGoodsOrders.cityName = cityName;
  }
  final String? areaName = jsonConvert.convert<String>(json['areaName']);
  if (areaName != null) {
    waitForPurchaseGoodsOrders.areaName = areaName;
  }
  final String? villageName = jsonConvert.convert<String>(json['villageName']);
  if (villageName != null) {
    waitForPurchaseGoodsOrders.villageName = villageName;
  }
  final String? address = jsonConvert.convert<String>(json['address']);
  if (address != null) {
    waitForPurchaseGoodsOrders.address = address;
  }
  final String? stationTime = jsonConvert.convert<String>(json['stationTime']);
  if (stationTime != null) {
    waitForPurchaseGoodsOrders.stationTime = stationTime;
  }
  return waitForPurchaseGoodsOrders;
}

Map<String, dynamic> $WaitForPurchaseGoodsOrdersToJson(
    WaitForPurchaseGoodsOrders entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['orderId'] = entity.orderId;
  data['orderNumber'] = entity.orderNumber;
  data['count'] = entity.count;
  data['consignee'] = entity.consignee;
  data['mobilePhone'] = entity.mobilePhone;
  data['provinceName'] = entity.provinceName;
  data['cityName'] = entity.cityName;
  data['areaName'] = entity.areaName;
  data['villageName'] = entity.villageName;
  data['address'] = entity.address;
  data['stationTime'] = entity.stationTime;
  return data;
}
